<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>sendLoginDataAndGetJSON</title>
<script src="../js/jquery-1.3.2.js"></script>
<script>
function sendJsonToAction() {
   var dataToSend = [$("#username").val(), $("#password").val()];
   
   jQuery.each(dataToSend, function(index, value) {
	   alert(index +  " : " + value);
   });
	 
   $.getJSON("/struts2Fill/sendLoginDataAndGetJSON.action", dataToSend, function(json){
	   alert("JSON Data from JSONUsernamePasswordStorage: \n  " 
			   + json);
   });
}

</script>
</head>
<body>

    <input id="username" type="text" />
    <input id="password" type="password" />
    <input type="button" value="sendJSON" onclick="sendJsonToAction();"/> <p/>


</body>
</html>